<template>
  <div class="">
    <van-nav-bar
      title="严选专栏"
      left-text=""
      left-arrow
      @click-left="$router.go(-1)"
    />
    <div class="content">
      <div
        :style="`background:url(${v.pic})`"
        v-for="(v, i) in obj"
        :key="i"
        class="box"
      >
        <p v-html="v.title"></p>
        <p class="lettering" v-html="v.descript"></p>
        <button @click="detailslook(v.id)">查看详情</button>
      </div>
    </div>
  </div>
</template>

<script>
import { ref } from "vue";
import { siftObj } from "@/api";
import { useRouter } from "vue-router";
export default {
  setup() {
    const obj = ref([]);
    let router = useRouter();
    siftObj().then((result) => {
      obj.value = result;
    });
    function detailslook(id) {
      console.log(1);
      console.log(id);
      router.push({ path: "/lookDetails", query: { id: id } });
    }
    return {
      obj,
      detailslook,
    };
  },
};
</script>

<style lang="scss" scoped>
.content {
  padding: 10px;
}
.box {
  width: 100%;
  height: 400px;
  background-size: 100% !important;
  background-repeat: no-repeat;
  border-radius: 22px;
  margin-bottom: 10px;
  padding-top: 80px;
  p {
    margin-bottom: 35px;
    &:nth-child(1) {
      font-size: 35px;
    }
    color: #fff;
    font-size: 28px;
    text-align: center;
  }
  button {
    background-color: transparent;
    border: 1px solid rgb(248, 245, 245);
    font-size: 26px;
    width: 190px;
    height: 68px;
    color: #fff;
    border-radius: 60px;
    margin-left: 37%;
  }
}
</style>
